/*
 * File:   test_point.cpp
 * Author: steve
 *
 * Created on 16-Jan-2013, 21:18:59
 */

#include "test_point.h"
#include "point.h"


CPPUNIT_TEST_SUITE_REGISTRATION(test_point);

test_point::test_point() {
}

test_point::~test_point() {
}

void test_point::setUp() {
}

void test_point::tearDown() {
}

void test_point::testPoint() {
    point _point;
    if (true /*check result*/) {
        CPPUNIT_ASSERT(_point.x == 0.0);
        CPPUNIT_ASSERT(_point.y == 0.0);
        CPPUNIT_ASSERT(_point.z == 0.0);
    }
}

void test_point::testPoint2() {
    double x = 1.0;
    double y = 2.0;
    double z = 3.0;
    point _point(x, y, z);
    if (true /*check result*/) {
        CPPUNIT_ASSERT(_point.x == x);
        CPPUNIT_ASSERT(_point.y == y);
        CPPUNIT_ASSERT(_point.z == z);
    }
}

void test_point::testPoint3() {
    point orig(1.0,2.0,3.0);
    point _point(orig);
    if (true /*check result*/) {
        CPPUNIT_ASSERT(_point.x == 1.0);
        CPPUNIT_ASSERT(_point.y == 2.0);
        CPPUNIT_ASSERT(_point.z == 3.0);
    }
}

void test_point::testPoint4() {
    point other(1.0,2.0,3.0);
    point _point;
    _point = other;
    if (true /*check result*/) {
        CPPUNIT_ASSERT(_point.x == 1.0);
        CPPUNIT_ASSERT(_point.y == 2.0);
        CPPUNIT_ASSERT(_point.z == 3.0);
    }
}

void test_point::testPoint5() {
    point pt1(1.0,2.0,3.0);
    point pt2(2.0,4.0,6.0);
    point _point;
    _point = pt1+pt2;
    if (true /*check result*/) {
        CPPUNIT_ASSERT(_point.x == 3.0);
        CPPUNIT_ASSERT(_point.y == 6.0);
        CPPUNIT_ASSERT(_point.z == 9.0);
    }
}

void test_point::testPoint6() {
    point pt1(1.0,2.0,3.0);
    point pt2(2.0,4.0,6.0);
    point _point;
    _point = pt2-pt1;
    if (true /*check result*/) {
        CPPUNIT_ASSERT(_point.x == 1.0);
        CPPUNIT_ASSERT(_point.y == 2.0);
        CPPUNIT_ASSERT(_point.z == 3.0);
    }
}